<?php
class Custom_View_Helper_Linkto extends Zend_View_Helper_HtmlElement
{
    public function linkTo($text, $path, $attribs = null)
    {
        if ('#' == $path) {
            $url = 'javascript:void(0);';
        } else if ('homepage' == $path) {
            $url = $this->view->baseUrl();
        } else {
            $url = $this->view->urlFor($path);
        }

        if (null === $attribs) {
            $options = '';
        } else {
            $options = $this->_htmlAttribs(
                Custom_Utility_Parse::stringToArray($attribs)
            );
        }

        return '<a href="' . $url . '" ' . $options . '>' . $text . '</a>';
    }
}